The entries() method
The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.
Version ≥ 6
var letters = ['a','b','c'];
for(const[index,element] of letters.entries()){ console.log(index,element);
}
result
0 "a"
1 "b"
2 "c"